import service from '@/utils/request'

// ########################  机构管理  ##################################
export function getManagerTree() { // 获取树状机构信息
  return service.get('/manager/business-hall/tree')
}

export function getManagerDetails(id) { // 获取机构详情+
  return service.get(`/manager/business-hall/${id}`)
}

export function getPagingMessage(params) { // 获取员工分页信息
  return service.get('/manager/business-hall/user/page', { params })
}

export function updateInstitution(data) { // 获取员工分页信息
  return service.post('/manager/business-hall', data)
}

// $$$$$$$$$$$$$$$$$$$$$$$$$$ 业务范围   $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
export function getScopeBusiness(id, type) { // 获取业务范围
  return service.get(`/manager/business-hall/scope/${id}/${type}`)
}

//! !!!!!!!!!!!!!!!!!!!!!!!!  运费管理   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
export function getFreightList() { // 获取运费列表
  return service.get('/manager/carriages')
}

export function addFreight(data) { // 新增/修改运费模板
  return service.post('/manager/carriages', data)
}

export function delFreight(id) { // 删除运费模板
  return service.delete(`/manager/carriages/${id}`)
}
